package 队列;

public class 约瑟夫环 {
    public static void main(String[] args) throws Exception {
        int n  =41;
        CirQueue c = new CirQueue(50);
        for (int i = 1; i <= n; i++) {
            c.append(i);
        }
        while(c.size()!=2){
                c.append(c.delete());
                c.append(c.delete());
                c.delete();
        }
        System.out.println("位置：");
        c.print();
    }
}
